package com.lhnstart.learn.bases.polyarr;

/**
 * 测试类
 *
 * @author lhn
 * @date 2023/06/07 16:26
 * @since 1.0.0
 **/
public class PloyArray {

    public static void main(String[] args) {
        Person[] persons = new Person[5];
        persons[0] = new Person("jack", 20);
        persons[1] = new Student("jack", 18, 100);
        persons[2] = new Student("smith", 19, 30.1);
        persons[3] = new Teacher("scott", 30, 20000);
        persons[4] = new Teacher("king", 50, 25000);

        for (Person person : persons) {
            System.out.println(person.say());
        }

    }

}